home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
c't freeware shareware 1997
/
CT_SW_97.ISO
/
pc
/
software
/
entwickl
/
macos
/
waste13a.hqx
/
WASTE 1.3a3 Distribution
/
WASTE Pascal Interfaces
/
WASTE.p
< prev
next >
Wrap
Text File
|
1997-01-06
|
29KB
|
939 lines
UNIT WASTE;
{ Pascal interface to the WASTE text engine }
{ version 1.3a3 (January 1997) }
{ Copyright © 1993-1997 Marco Piovanelli }
{ All Rights Reserved }
INTERFACE
USES
ConditionalMacros,
Types,
MixedMode,
QuickdrawText,
Quickdraw,
Script,
TextUtils,
TextEdit,
Drag,
LongCoords;
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
CONST
{ result codes }
weCantUndoErr = -10015; { undo buffer is clear (= errAECantUndo) }
weEmptySelectionErr = -10013; { empty selection range (= errAENoUserSelection) }
weNotHandledErr = -1708; { please use default behavior (= errAEEventNotHandled) }
weUnknownObjectTypeErr = -9478; { specified object type is not registered }
weObjectNotFoundErr = -9477; { no object found at specified offset }
weReadOnlyErr = -9476; { cannot modify instance }
weUndefinedSelectorErr = -50; { unknown selector (= paramErr) }
{ alignment styles }
weFlushLeft = -2; { flush left }
weFlushRight = -1; { flush right }
weFlushDefault = 0; { flush according to system direction }
weCenter = 1; { centered }
weJustify = 2; { fully justified }
{ primary line direction }
weDirDefault = 1; { according to system direction }
weDirRightToLeft = -1; { force right-to-left }
weDirLeftToRight = 0; { force left-to-right }
{ values for the mode parameter in WESetStyle and WEContinuousStyle }
weDoFont = $0001; { set font family number }
weDoFace = $0002; { set Quickdraw styles }
weDoSize = $0004; { set type size }
weDoColor = $0008; { set color }
weDoAll = weDoFont + weDoFace + weDoSize + weDoColor;
weDoAddSize = $0010; { adjust type size }
weDoToggleFace = $0020; { turn a style off if it's continuous over the selection }
weDoReplaceFace = $0040; { replace existing styles outright }
weDoPreserveScript = $0080; { don't change scripts when applying a font change }
weDoExtractSubscript = $0100; { extract subscripts when applying a font change }
weDoFaceMask = $0200; { set Quickdraw styles using mask field }
{ values for the edge parameter in WEGetOffset etc. }
kLeadingEdge = -1; { point is on the leading edge of a glyph }
kTrailingEdge = 0; { point is on the trailing edge of a glyph }
kObjectEdge = 2; { point is in the middle of an embedded object }
{ values for WEFeatureFlag feature parameter }
weFAutoScroll = 0; { automatically scroll the selection range into view }
weFOutlineHilite = 2; { frame selection when deactivated }
weFReadOnly = 5; { disallow modifications }
weFUndo = 6; { support WEUndo }
weFIntCutAndPaste = 7; { use intelligent cut-and-paste rules }
weFDragAndDrop = 8; { support drag-and-drop text editing }
weFInhibitRecal = 9; { don't recalculate line starts and don't redraw text }
weFUseTempMem = 10; { use temporary memory for main data structures }
weFDrawOffscreen = 11; { draw text offscreen for smoother visual results }
weFInhibitRedraw = 12; { don't redraw text }
weFMonoStyled = 13; { disallow style changes }
weFInhibitColor = 31; { draw in black & white only }
{ values for WENew flags parameter }
weDoAutoScroll = $00000001;
weDoOutlineHilite = $00000004;
weDoReadOnly = $00000020;
weDoUndo = $00000040;
weDoIntCutAndPaste = $00000080;
weDoDragAndDrop = $00000100;
weDoInhibitRecal = $00000200;
weDoUseTempMem = $00000400;
weDoDrawOffscreen = $00000800;
weDoInhibitRedraw = $00001000;
weDoMonoStyled = $00002000;
weDoInhibitColor = $80000000;
{ values for WEFeatureFlag action parameter }
weBitToggle = -2; { toggles the specified feature }
weBitTest = -1; { returns the current setting of the specified feature }
weBitClear = 0; { disables the specified feature }
weBitSet = 1; { enables the specified feature }
{ values for WEGetInfo and WESetInfo selector parameter }
weCharByteHook = 'cbyt'; { CharByte hook }
weCharToPixelHook = 'c2p '; { CharToPixel hook }
weCharTypeHook = 'ctyp'; { CharType hook }
weClickLoop = 'clik'; { click loop callback }
weCurrentDrag = 'drag'; { drag currently being tracked from WEClick }
weDrawTextHook = 'draw'; { text drawing hook }
weEraseHook = 'eras'; { background erasing hook }
weHiliteDropAreaHook = 'hidr'; { drop area highlighting hook }
weLineBreakHook = 'lbrk'; { line breaking hook }
wePixelToCharHook = 'p2c '; { PixelToChar hook }
wePort = 'port'; { graphics port }
weRefCon = 'refc'; { reference constant for use by application }
weScrollProc = 'scrl'; { scroll callback }
weText = 'text'; { handle to the raw text }
weTranslateDragHook = 'xdrg'; { drag translation callback }
weTranslucencyThreshold = 'tluc'; { area threshold for translucent drags }
weTSMDocumentID = 'tsmd'; { Text Services Manager document ID }
weTSMPreUpdate = 'pre '; { Text Services Manager pre-update callback }
weTSMPostUpdate = 'post'; { Text Services Manager post-update callback }
weURLHint = 'urlh'; { URL hint string for Internet Config }
weWordBreakHook = 'wbrk'; { word breaking hook }
{ values for WEInstallObjectHandler handlerSelector parameter }
weNewHandler = 'new '; { new handler }
weDisposeHandler = 'free'; { dispose handler }
weDrawHandler = 'draw'; { draw handler }
weClickHandler = 'clik'; { click handler }
weStreamHandler = 'strm'; { stream handler }
{ action kinds }
weAKNone = 0; { null action }
weAKUnspecified = 1; { action of unspecified nature }
weAKTyping = 2; { some text has been typed in }
weAKCut = 3; { the selection range has been cut }
weAKPaste = 4; { something has been pasted }
weAKClear = 5; { the selection range has been deleted }
weAKDrag = 6; { drag and drop operation }
weAKSetStyle = 7; { some style has been applied to a text range }
{ destination kinds for stream handler }
weToScrap = 0;
weToDrag = 1;
weToSoup = 2;
TYPE
{ WASTE data types }
WEReference = Ptr;
WEObjectReference = Ptr;
WESoupHandle = Handle;
WEFontTableHandle = Handle;
WEActionKind = INTEGER;
WEAlignment = SignedByte;
WEDirection = INTEGER;
WEStyleMode = INTEGER;
WESelector = FourCharCode;
WEHandle = WEReference; { obsolete; kept for backward compatibility }
WERunInfo = RECORD
runStart: LONGINT; { byte offset to first character of style run }
runEnd: LONGINT; { byte offset past last character of style run }
runHeight: INTEGER; { line height (ascent + descent + leading) }
runAscent: INTEGER; { font ascent }
runStyle: TextStyle; { text attributes }
runObject: WEObjectReference; { either NIL or reference to embedded object }
END; { WERunInfo }
{ callback prototypes }
{ FUNCTION MyClickLoop (we: WEReference): BOOLEAN; }
WEClickLoopProcPtr = ProcPtr;
WEClickLoopUPP = UniversalProcPtr;
{ PROCEDURE MyScrollProc (we: WEReference); }
WEScrollProcPtr = ProcPtr;
WEScrollUPP = UniversalProcPtr;
{ PROCEDURE MyTSMPreUpdate (we: WEReference); }
WETSMPreUpdateProcPtr = ProcPtr;
WETSMPreUpdateUPP = UniversalProcPtr;
{ PROCEDURE MyTSMPostUpdate (we: WEReference; fixLength: LONGINT; }
{ inputAreaStart, inputAreaEnd: LONGINT; }
{ pinRangeStart, pinRangeEnd: LONGINT); }
WETSMPostUpdateProcPtr = ProcPtr;
WETSMPostUpdateUPP = UniversalProcPtr;
{ FUNCTION MyTranslateDrag (theDrag: DragReference; theItem: ItemReference; }
{ requestedType: FlavorType; putDataHere: Handle; }
{ dropOffset: LONGINT; we: WEReference): OSErr; }
WETranslateDragProcPtr = ProcPtr;
WETranslateDragUPP = UniversalProcPtr;
{ FUNCTION MyHiliteDropArea (theDrag: DragReference; hiliteFlag: BOOLEAN; }
{ we: WEReference): OSErr; }
WEHiliteDropAreaProcPtr = ProcPtr;
WEHiliteDropAreaUPP = UniversalProcPtr;
{ FUNCTION MyFontIDToName (fontID: INTEGER; VAR fontName: Str255): OSErr; }
WEFontIDToNameProcPtr = ProcPtr;
WEFontIDToNameUPP = UniversalProcPtr;
{ FUNCTION MyFontNameToID (fontName: Str255; oldFontID: INTEGER; }
{ VAR newFontID: INTEGER): OSErr; }
WEFontNameToIDProcPtr = ProcPtr;
WEFontNameToIDUPP = UniversalProcPtr;
{ PROCEDURE MyDrawText (pText: Ptr; textLength: LONGINT; slop: Fixed; }
{ styleRunPosition: JustStyleCode; we: WEReference); }
WEDrawTextProcPtr = ProcPtr;
WEDrawTextUPP = UniversalProcPtr;
{ FUNCTION MyPixelToChar (pText: Ptr; textLength: LONGINT; slop: Fixed; }
{ VAR pixelWidth: Fixed; VAR edge: SignedByte; }
{ styleRunPosition: JustStyleCode; hPos: Fixed; we: WEReference): LONGINT; }
WEPixelToCharProcPtr = ProcPtr;
WEPixelToCharUPP = UniversalProcPtr;
{ FUNCTION MyCharToPixel (pText: Ptr; textLength: LONGINT; slop: Fixed; }
{ offset: LONGINT; direction: INTEGER; }
{ styleRunPosition: JustStyleCode; hPos: INTEGER; we:WEReference): INTEGER; }
WECharToPixelProcPtr = ProcPtr;
WECharToPixelUPP = UniversalProcPtr;
{ FUNCTION MyLineBreak (pText: Ptr; textLength: LONGINT; }
{ textStart, textEnd: LONGINT; VAR textWidth: Fixed; VAR textOffset: LONGINT; }
{ we: WEReference): StyledLineBreakCode; }
WELineBreakProcPtr = ProcPtr;
WELineBreakUPP = UniversalProcPtr;
{ PROCEDURE MyWordBreak (pText: Ptr; textLength, offset: INTEGER; edge: SignedByte; }
{ VAR breakOffsets: OffsetTable; script: ScriptCode; we: WEReference); }
WEWordBreakProcPtr = ProcPtr;
WEWordBreakUPP = UniversalProcPtr;
{ FUNCTION MyCharByte (pText: Ptr; textOffset: INTEGER; }
{ script: ScriptCode; we: WEReference): INTEGER; }
WECharByteProcPtr = ProcPtr;
WECharByteUPP = UniversalProcPtr;
{ FUNCTION MyCharType (pText: Ptr; textOffset: INTEGER; }
{ script: ScriptCode; we: WEReference): INTEGER; }
WECharTypeProcPtr = ProcPtr;
WECharTypeUPP = UniversalProcPtr;
{ PROCEDURE MyErase (VAR area: Rect; we: WEReference); }
WEEraseProcPtr = ProcPtr;
WEEraseUPP = UniversalProcPtr;
{ FUNCTION MyNewObject (VAR defaultObjectSize: Point; }
{ objectRef: WEObjectReference): OSErr; }
WENewObjectProcPtr = ProcPtr;
WENewObjectUPP = UniversalProcPtr;
{ FUNCTION MyDisposeObject (objectRef: WEObjectReference): OSErr; }
WEDisposeObjectProcPtr = ProcPtr;
WEDisposeObjectUPP = UniversalProcPtr;
{ FUNCTION MyDrawObject (VAR destRect: Rect; }
{ objectRef: WEObjectReference): OSErr }
WEDrawObjectProcPtr = ProcPtr;
WEDrawObjectUPP = UniversalProcPtr;
{ FUNCTION MyClickObject (hitPt: Point; modifiers: EventModifiers; clickTime: LONGINT; }
{ objectRef: WEObjectReference): BOOLEAN; }
WEClickObjectProcPtr = ProcPtr;
WEClickObjectUPP = UniversalProcPtr;
{ FUNCTION MyStreamObject (destKind: INTEGER; VAR theType: FlavorType; }
{ putDataHere: Handle; objectRef: WEObjectReference): OSErr; }
WEStreamObjectProcPtr = ProcPtr;
WEStreamObjectUPP = UniversalProcPtr;
CONST
{ UPP proc info }
uppWEClickLoopProcInfo = $000000D0;
uppWEScrollProcInfo = $000000C0;
uppWETSMPreUpdateProcInfo = $000000C0;
uppWETSMPostUpdateProcInfo = $0003FFC0;
uppWETranslateDragProcInfo = $0003FFE0;
uppWEHiliteDropAreaProcInfo = $00000DE0;
uppWEFontIDToNameProcInfo = $000003A0;
uppWEFontNameToIDProcInfo = $00000EE0;
uppWEDrawTextProcInfo = $0000EFC0;
uppWEPixelToCharProcInfo = $003EFFF0;
uppWECharToPixelProcInfo = $003ABFE0;
uppWELineBreakProcInfo = $000FFFD0;
uppWEWordBreakProcInfo = $000EDAC0;
uppWECharByteProcInfo = $00003AE0;
uppWECharTypeProcInfo = $00003AE0;
uppWEEraseProcInfo = $000003C0;
uppWENewObjectProcInfo = $000003E0;
uppWEDisposeObjectProcInfo = $000000E0;
uppWEDrawObjectProcInfo = $000003E0;
uppWEClickObjectProcInfo = $00003ED0;
uppWEStreamObjectProcInfo = $00003FA0;
{ NewProc macros }
FUNCTION NewWEClickLoopProc (userRoutine: WEClickLoopProcPtr): WEClickLoopUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEScrollProc (userRoutine: WEScrollProcPtr): WEScrollUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWETSMPreUpdateProc (userRoutine: WETSMPreUpdateProcPtr): WETSMPreUpdateUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWETSMPostUpdateProc (userRoutine: WETSMPostUpdateProcPtr): WETSMPostUpdateUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWETranslateDragProc (userRoutine: WETranslateDragProcPtr): WETranslateDragUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEHiliteDropAreaProc (userRoutine: WEHiliteDropAreaProcPtr): WEHiliteDropAreaUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEFontIDToNameProc (userRoutine: WEFontIDToNameProcPtr): WEFontIDToNameUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEFontNameToIDProc (userRoutine: WEFontNameToIDProcPtr): WEFontNameToIDUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEDrawTextProc (userRoutine: WEDrawTextProcPtr): WEDrawTextUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEPixelToCharProc (userRoutine: WEPixelToCharProcPtr): WEPixelToCharUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWECharToPixelProc (userRoutine: WECharToPixelProcPtr): WECharToPixelUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWELineBreakProc (userRoutine: WELineBreakProcPtr): WELineBreakUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEWordBreakProc (userRoutine: WEWordBreakProcPtr): WEWordBreakUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWECharByteProc (userRoutine: WECharByteProcPtr): WECharByteUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWECharTypeProc (userRoutine: WECharTypeProcPtr): WECharTypeUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEEraseProc (userRoutine: WEEraseProcPtr): WEEraseUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWENewObjectProc (userRoutine: WENewObjectProcPtr): WENewObjectUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEDisposeObjectProc (userRoutine: WEDisposeObjectProcPtr): WEDisposeObjectUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEDrawObjectProc (userRoutine: WEDrawObjectProcPtr): WEDrawObjectUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEClickObjectProc (userRoutine: WEClickObjectProcPtr): WEClickObjectUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
FUNCTION NewWEStreamObjectProc (userRoutine: WEStreamObjectProcPtr): WEStreamObjectUPP;
{$IFC NOT GENERATINGCFM}
INLINE
$2E9F;
{$ENDC}
{ CallProc macros }
FUNCTION CallWEClickLoopProc (we: WEReference;
userRoutine: WEClickLoopUPP): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
PROCEDURE CallWEScrollProc (we: WEReference;
userRoutine: WEScrollUPP);
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
PROCEDURE CallWETSMPreUpdateProc (we: WEReference;
userRoutine: WETSMPreUpdateUPP);
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
PROCEDURE CallWETSMPostUpdateProc (we: WEReference;
fixLength: LONGINT;
inputAreaStart, inputAreaEnd: LONGINT;
pinRangeStart, pinRangeEnd: LONGINT;
userRoutine: WETSMPostUpdateUPP);
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWETranslateDragProc (theDrag: DragReference;
theItem: ItemReference;
requestedType: FlavorType;
putDataHere: Handle;
dropOffset: LONGINT;
we: WEReference;
userRoutine: WETranslateDragUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEHiliteDropAreaProc (theDrag: DragReference;
hiliteFlag: BOOLEAN;
we: WEReference;
userRoutine: WEHiliteDropAreaUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEFontIDToNameProc (fontID: INTEGER;
VAR fontName: Str255;
userRoutine: WEFontIDToNameUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEFontNameToIDProc ({CONST} VAR fontName: Str255;
oldFontID: INTEGER;
VAR newFontID: INTEGER;
userRoutine: WEFontNameToIDUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
PROCEDURE CallWEDrawTextProc (pText: Ptr;
textLength: LONGINT;
slop: Fixed;
styleRunPosition: JustStyleCode;
we: WEReference;
userRoutine: WEDrawTextUPP);
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEPixelToCharProc (pText: Ptr;
textLength: LONGINT;
slop: Fixed;
VAR width: Fixed;
VAR edge: SignedByte;
styleRunPosition: JustStyleCode;
hPos: Fixed;
we: WEReference;
userRoutine: WEPixelToCharUPP): LONGINT;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWECharToPixelProc (pText: Ptr;
textLength: LONGINT;
slop: Fixed;
offset: LONGINT;
direction: INTEGER;
styleRunPosition: JustStyleCode;
hPos: INTEGER;
we: WEReference;
userRoutine: WECharToPixelUPP): INTEGER;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWELineBreakProc (pText: Ptr;
textLength: LONGINT;
textStart, textEnd: LONGINT;
VAR textWidth: Fixed;
VAR textOffset: LONGINT;
we: WEReference;
userRoutine: WELineBreakUPP): StyledLineBreakCode;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
PROCEDURE CallWEWordBreakProc (pText: Ptr;
textLength, offset: INTEGER;
edge: SignedByte;
VAR breakOffsets: OffsetTable;
script: ScriptCode;
we: WEReference;
userRoutine: WEWordBreakUPP);
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWECharByteProc (pText: Ptr;
textOffset: INTEGER;
script: ScriptCode;
we: WEReference;
userRoutine: WECharByteUPP): INTEGER;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWECharTypeProc (pText: Ptr;
textOffset: INTEGER;
script: ScriptCode;
we: WEReference;
userRoutine: WECharTypeUPP): INTEGER;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
PROCEDURE CallWEEraseProc ({CONST} VAR area: Rect;
we: WEReference;
userRoutine: WEEraseUPP);
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWENewObjectProc (VAR defaultObjectSize: Point;
objectRef: WEObjectReference;
userRoutine: WENewObjectUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEDisposeObjectProc (objectRef: WEObjectReference;
userRoutine: WEDisposeObjectUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEDrawObjectProc ({CONST} VAR destRect: Rect;
objectRef: WEObjectReference;
userRoutine: WEDrawObjectUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEClickObjectProc (hitPoint: Point;
modifiers: EventModifiers;
clickTime: LONGINT;
objectRef: WEObjectReference;
userRoutine: WEClickObjectUPP): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
FUNCTION CallWEStreamObjectProc (destKind: INTEGER;
VAR theType: FlavorType;
putDataHere: Handle;
objectRef: WEObjectReference;
userRoutine: WEStreamObjectUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE
$205F, $4E90;
{$ENDC}
{ WASTE PUBLIC CALLS }
{ getting the shared library version number }
FUNCTION WEVersion: NumVersion;
{ creation and destruction }
FUNCTION WENew ({CONST} VAR destRect, viewRect: LongRect;
flags: LONGINT;
VAR we: WEReference): OSErr;
PROCEDURE WEDispose (we: WEReference);
{ getting variables }
FUNCTION WEGetText (we: WEReference): Handle;
FUNCTION WEGetChar (offset: LONGINT;
we: WEReference): CHAR;
FUNCTION WEGetTextLength (we: WEReference): LONGINT;
FUNCTION WEGetHeight (startLine, endLine: LONGINT;
we: WEReference): LONGINT;
PROCEDURE WEGetSelection (VAR selStart, selEnd: LONGINT;
we: WEReference);
PROCEDURE WEGetDestRect (VAR destRect: LongRect;
we: WEReference);
PROCEDURE WEGetViewRect (VAR viewRect: LongRect;
we: WEReference);
FUNCTION WEIsActive (we: WEReference): BOOLEAN;
FUNCTION WEOffsetToLine (offset: LONGINT;
we: WEReference): LONGINT;
PROCEDURE WEGetLineRange (lineNo: LONGINT;
VAR lineStart, lineEnd: LONGINT;
we: WEReference);
FUNCTION WECountLines (we: WEReference): LONGINT;
FUNCTION WEOffsetToRun (offset: LONGINT;
we: WEReference): LONGINT;
PROCEDURE WEGetRunRange (runIndex: LONGINT;
VAR runStart, runEnd: LONGINT;
we: WEReference);
FUNCTION WECountRuns (we: WEReference): LONGINT;
FUNCTION WEGetClickCount (we: WEReference): INTEGER;
{ setting variables }
PROCEDURE WESetSelection (selStart, selEnd: LONGINT;
we: WEReference);
PROCEDURE WESetDestRect ({CONST} VAR destRect: LongRect;
we: WEReference);
PROCEDURE WESetViewRect ({CONST} VAR viewRect: LongRect;
we: WEReference);
{ accessing style run information }
FUNCTION WEContinuousStyle (VAR mode: WEStyleMode;
VAR ts: TextStyle;
we: WEReference): BOOLEAN;
PROCEDURE WEGetRunInfo (offset: LONGINT;
VAR info: WERunInfo;
we: WEReference);
{ converting byte offsets to screen positions and vice versa }
FUNCTION WEGetOffset ({CONST} VAR thePoint: LongPt;
VAR edge: SignedByte;
we: WEReference): LONGINT;
PROCEDURE WEGetPoint (offset: LONGINT;
direction: INTEGER;
VAR thePoint: LongPt;
VAR lineHeight: INTEGER;
we: WEReference);
{ finding words and lines }
PROCEDURE WEFindWord (offset: LONGINT;
edge: SignedByte;
VAR wordStart, wordEnd: LONGINT;
we: WEReference);
PROCEDURE WEFindLine (offset: LONGINT;
edge: SignedByte;
VAR lineStart, lineEnd: LONGINT;
we: WEReference);
{ making a copy of a text range }
FUNCTION WECopyRange (rangeStart, rangeEnd: LONGINT;
hText: Handle;
hStyles: StScrpHandle;
hSoup: WESoupHandle;
we: WEReference): OSErr;
{ getting and setting the alignment style }
FUNCTION WEGetAlignment (we: WEReference): WEAlignment;
PROCEDURE WESetAlignment (alignment: WEAlignment;
we: WEReference);
{ getting and setting the primary line direction }
FUNCTION WEGetDirection (we: WEReference): WEDirection;
PROCEDURE WESetDirection (direction: WEDirection;
we: WEReference);
{ recalculating line breaks, drawing and scrolling }
FUNCTION WECalText (we: WEReference): OSErr;
PROCEDURE WEUpdate (updateRgn: RgnHandle;
we: WEReference);
PROCEDURE WEScroll (hOffset, vOffset: LONGINT;
we: WEReference);
PROCEDURE WESelView (we: WEReference);
{ handling activate/deactivate events }
PROCEDURE WEActivate (we: WEReference);
PROCEDURE WEDeactivate (we: WEReference);
{ handling key-down events }
PROCEDURE WEKey (key: CHAR;
modifiers: EventModifiers;
we: WEReference);
{ handling mouse-down events and mouse tracking }
PROCEDURE WEClick (hitPt: Point;
modifiers: EventModifiers;
clickTime: LONGINT;
we: WEReference);
{ adjusting the cursor shape }
FUNCTION WEAdjustCursor (mouseLoc: Point;
mouseRgn: RgnHandle;
we: WEReference): BOOLEAN;
{ blinking the caret }
PROCEDURE WEIdle (VAR maxSleep: LONGINT;
we: WEReference);
{ modifying the text and the styles }
FUNCTION WEInsert (pText: Ptr;
textLength: LONGINT;
hStyles: StScrpHandle;
hSoup: WESoupHandle;
we: WEReference): OSErr;
FUNCTION WEDelete (we: WEReference): OSErr;
FUNCTION WESetStyle (mode: WEStyleMode;
{CONST} VAR ts: TextStyle;
we: WEReference): OSErr;
FUNCTION WEUseText (hText: Handle;
we: WEReference): OSErr;
FUNCTION WEUseStyleScrap (hStyles: StScrpHandle;
we: WEReference): OSErr;
{ undo }
FUNCTION WEUndo (we: WEReference): OSErr;
PROCEDURE WEClearUndo (we: WEReference);
FUNCTION WEGetUndoInfo (VAR redoFlag: BOOLEAN;
we: WEReference): WEActionKind;
FUNCTION WEIsTyping (we: WEReference): BOOLEAN;
FUNCTION WEBeginAction (we: WEReference): OSErr;
FUNCTION WEEndAction (actionKind: WEActionKind;
we: WEReference): OSErr;
{ keeping track of changes }
FUNCTION WEGetModCount (we: WEReference): LONGINT;
PROCEDURE WEResetModCount (we: WEReference);
{ embedded objects }
FUNCTION WEInstallObjectHandler (objectType: FlavorType;
handlerSelector: WESelector;
handler: ProcPtr;
we: WEReference): OSErr;
FUNCTION WEGetObjectHandler (objectType: FlavorType;
handlerSelector: WESelector;
VAR handler: ProcPtr;
we: WEReference): OSErr;
FUNCTION WEInsertObject (objectType: FlavorType;
objectDataHandle: Handle;
objectSize: Point; { (0, 0) means default size }
we: WEReference): OSErr;
FUNCTION WEGetSelectedObject (VAR objectRef: WEObjectReference;
we: WEReference): OSErr;
FUNCTION WEFindNextObject (offset: LONGINT;
VAR objectRef: WEObjectReference;
we: WEReference): LONGINT;
FUNCTION WEUseSoup (hSoup: WESoupHandle;
we: WEReference): OSErr;
{ accessing embedded object attributes }
FUNCTION WEGetObjectType (objectRef: WEObjectReference): FlavorType;
FUNCTION WEGetObjectDataHandle (objectRef: WEObjectReference): Handle;
FUNCTION WEGetObjectSize (objectRef: WEObjectReference): Point;
FUNCTION WEGetObjectOwner (objectRef: WEObjectReference): WEReference;
FUNCTION WEGetObjectRefCon (objectRef: WEObjectReference): LONGINT;
PROCEDURE WESetObjectRefCon (objectRef: WEObjectReference;
refCon: LONGINT);
{ Clipboard operations }
FUNCTION WECut (we: WEReference): OSErr;
FUNCTION WECopy (we: WEReference): OSErr;
FUNCTION WEPaste (we: WEReference): OSErr;
FUNCTION WECanPaste (we: WEReference): BOOLEAN;
{ Drag Manager support }
FUNCTION WEGetHiliteRgn (rangeStart, rangeEnd: LONGINT;
we: WEReference): RgnHandle;
FUNCTION WETrackDrag (message: DragTrackingMessage;
drag: DragReference;
we: WEReference): OSErr;
FUNCTION WEReceiveDrag (drag: DragReference;
we: WEReference): OSErr;
FUNCTION WECanAcceptDrag (drag: DragReference;
we: WEReference): BOOLEAN;
FUNCTION WEDraggedToTrash (drag: DragReference): BOOLEAN;
{ font tables }
FUNCTION WEBuildFontTable (hFontTable: WEFontTableHandle;
fontIDToNameProc: WEFontIDToNameUPP;
we: WEReference): OSErr;
FUNCTION WEUpdateFontTable (hFontTable: WEFontTableHandle;
fontNameToIDProc: WEFontNameToIDUPP;
VAR wasChanged: BOOLEAN): OSErr;
FUNCTION WEUpdateStyleScrap (hStyles: StScrpHandle;
hFontTable: WEFontTableHandle): OSErr;
{ Script Manager utilities }
FUNCTION WECharByte (offset: LONGINT;
we: WEReference): INTEGER;
FUNCTION WECharType (offset: LONGINT;
we: WEReference): INTEGER;
{ Text Services Manager support }
FUNCTION WEInstallTSMHandlers: OSErr;
FUNCTION WERemoveTSMHandlers: OSErr;
PROCEDURE WEStopInlineSession (we: WEReference);
{ additional features }
FUNCTION WEFeatureFlag (feature: INTEGER;
action: INTEGER;
we: WEReference): INTEGER;
FUNCTION WEGetInfo (selector: WESelector;
info: univ Ptr;
we: WEReference): OSErr;
FUNCTION WESetInfo (selector: WESelector;
info: univ Ptr;
we: WEReference): OSErr;
{ getting and setting user-defined info }
FUNCTION WEGetUserInfo (tag: WESelector;
VAR userInfo: LONGINT;
we: WEReference): OSErr;
FUNCTION WESetUserInfo (tag: WESelector;
userInfo: LONGINT;
we: WEReference): OSErr;
{ long coordinates utility routines }
PROCEDURE WELongPointToPoint ({CONST} VAR lp: LongPt;
VAR p: Point);
PROCEDURE WEPointToLongPoint (p: Point;
VAR lp: LongPt);
PROCEDURE WESetLongRect (VAR lr: LongRect;
left, top, right, bottom: LONGINT);
PROCEDURE WELongRectToRect ({CONST} VAR lr: LongRect;
VAR r: Rect);
PROCEDURE WERectToLongRect ({CONST} VAR r: Rect;
VAR lr: LongRect);
PROCEDURE WEOffsetLongRect (VAR lr: LongRect;
hOffset, vOffset: LONGINT);
FUNCTION WELongPointInLongRect ({CONST} VAR lp: LongPt;
{CONST} VAR lr: LongRect): BOOLEAN;
{$ALIGN RESET}
{$POP}
IMPLEMENTATION
END.